package bishi.Huawei;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @Classname AddTwoInteger
 * @Description TODO
 * @Date 2021/9/11 11:16
 * @Created by ASUS
 */
public class AddTwoInteger {

    public static void main(String[] args) {
        addTwoStringInteger();
    }

    public static void addTwoStringInteger() {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.nextLine();
        String b = scanner.nextLine();
        String tmp;
        if (a.length() < b.length()) {
            tmp = a;
            a = b;
            b = tmp;
        }
        // a > b length
        // 1111111
        // 0002539
        int aLength = a.length();
        int bLength = b.length();
        int t = a.length() - b.length();
        String newB = "";
        for (int i = 0; i < t; i++) {
            newB += "0";
        }
        b = newB + b;
        int c = 0;
        List<Integer> sums = new ArrayList<>();
        for (int i = 0; i < a.length(); i++) {
            int t_a = a.charAt(i) - '0';
            int t_b = b.charAt(i) - '0';
            int s = t_a + t_b + c;
            c = s / 10;
            sums.add(s % 10);
        }

        StringBuilder builder = new StringBuilder();

        for (Integer sum : sums) {
            builder.append(sum);
        }
        if (c != 0) builder.append("1");
        System.out.println(builder.reverse().toString());
    }


}

